package com.yc.chaoshi.cs_manage.service.impl;


import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yc.chaoshi.cs_manage.mapper.UmsRolesResourceMapper;
import com.yc.chaoshi.cs_manage.service.IUmsRolesResourceService;
import com.yc.chaoshi.entity.UmsRolesResource;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author xz
 * @since 2022-08-04
 */
@Service
public class UmsRolesResourceServiceImpl extends ServiceImpl<UmsRolesResourceMapper, UmsRolesResource> implements IUmsRolesResourceService {

    @Override
    public boolean delete(Integer resourceid, Integer roleid) {
        UpdateWrapper<UmsRolesResource> updateWrapper=new UpdateWrapper<>();
        updateWrapper.lambda().eq(UmsRolesResource::getRolesId,roleid)
                              .eq(UmsRolesResource::getResourceId,resourceid);
        if (this.baseMapper.delete(updateWrapper)==0){
            return false;
        }else {
            return true;
        }
    }
}
